﻿@using SimpleScrum.Areas.Scrum.Models
@using SimpleScrum.Utils
@{
    ViewBag.Title = "Initialize";
    Layout = "~/Areas/Scrum/Views/Shared/_Layout.cshtml";
    var organizationModel = new OrganizationModel();
    var projectModel = new ProjectModel();
    var organizations = organizationModel.GetOrganizations();
}
<div class="page-header position-relative">
    <h1>
        @ViewBag.Title
        <small>
            <i class="icon-double-angle-right"></i>
            Your First Settings
        </small>
    </h1>
</div><!--/.page-header-->
<div class="row-fluid">
    <div class="span10 offset1">
        @if (organizations.Count == 0)
        {
            <h3>Step: 1 of 3</h3>
            <div class="text-center">
                <h1 class="text-error">You didn't create any Organization!</h1>
                <h2>Create Your First Organization</h2>
                <a class="btn btn-success" href="@Url.Action("New", "Organization")">
                    <i class="clearfix"></i>
                     Create Organization
                </a>
            </div>
        }
        else
        {
            foreach (var organization in organizations)
            {
                organization.ProjectCollection = projectModel.GetProjects().ToList();
                if (organization.ProjectCollection.Count == 0)
                {
                    <h3>Step: 2 of 3</h3>
                    <div class="text-center">
                        <h1>@organization.Name</h1>
                        <h2 class="text-error">You didn't create any Project!</h2>
                        <h2>Create Your First Project</h2>
                        <a class="btn btn-success" href="@Url.Action("New", "Project")">
                            <i class="clearfix"></i>
                            Create Project
                        </a>
                    </div>
                }
                else
                {
                    <h3>Step: 3 of 3</h3>
                    <div class="text-center">
                        <h1>@organization.Name</h1>
                        <h2 class="text-error">You didn't set as any default Project!</h2>
                        @foreach (var project in organization.ProjectCollection)
                        {
                        <h3>
                            @project.Name >>>
                            <a class="btn btn-success" href="@Url.Action("SetAsDefaultProject", "Initialize", new {id = project.Id})">
                                set as default
                            </a>
                        </h3>
                        }
                    </div>
                }
            }
        }
    </div>
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}